package com.nanfang51g3.ckz.utils;

import android.app.Activity;
import android.content.Context;

import com.umeng.socialize.ShareAction;
import com.umeng.socialize.UMShareListener;
import com.umeng.socialize.bean.SHARE_MEDIA;
import com.umeng.socialize.media.UMImage;

/**
 * Created by Administrator on 2016/4/26.
 */
public class ShareUtils {


    public static ShareUtils instance = null;
    public static Context mContext = null;

    public static ShareUtils getInstance(Context context) {
        if (instance == null) {
            synchronized (ShareUtils.class) {
                if (instance == null) {
                    instance = new ShareUtils();
                }
            }
        }
        return instance;

    }




    public static void open(Activity activity, UMShareListener umShareListener,UMImage image, String title, String content, String url) {
        new ShareAction(activity)
                .setDisplayList(
                        SHARE_MEDIA.QQ,
                        SHARE_MEDIA.QZONE,
                        SHARE_MEDIA.WEIXIN,
                        SHARE_MEDIA.WEIXIN_CIRCLE)
                .withMedia(image)//图片
                .withTitle(title)//标题
                .withText(content)//内容
                .withTargetUrl(url)//链接
                .setCallback(umShareListener)//监听
                .open();
    }
}
